package cn.bossfriday.im.common.message.api.user;

import cn.bossfriday.common.utils.GsonUtil;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Size;

/**
 * GetTokenRequest
 *
 * @author chenx
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class GetTokenRequest {

    @NotEmpty(message = "userId mustn't be empty!")
    @Size(max = 64, message = "userId length must not exceed 64 characters!")
    private String userId;

    @Size(max = 64, message = "userName length must not exceed 64 characters!")
    private String userName;

    @NotEmpty(message = "deviceId mustn't be empty!")
    private String deviceId;

    @Override
    public String toString() {
        return GsonUtil.toJson(this);
    }
}
